<template>
  <div id="app">
     <router-view v-if="isRouterAlive" />
  </div>
</template>

<script>

import {getParams} from "@/utils/tools";

export default {
  name: "searchApp",
  provide() {
    return {
      reload: this.reload,
    };
  },
  data() {
    return {
      isRouterAlive: true,
    };
  },
  methods: {
    // 路由刷新不闪烁
    reload() {
      this.isRouterAlive = false;
      this.$nextTick(function () {
        this.isRouterAlive = true;
      });
    },

  },
  mounted() {
    this.$router.push({name: 'searchResultVue', query: {'keyword': getParams('keyword'), 'version': getParams('version')}})
  }
};
</script>

<style>
#app {
  width: 100%;
  height: 100%;
  display: flex;
  font-family: "Avenir", Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-align: center;
  color: #2c3e50;
}
a {
  text-decoration: none;
}
a:hover {
  color: blue;
  cursor: pointer;
}
</style>
